package com.ijunfu.study.jdk.jdk8.date;

import java.time.LocalTime;

/**
 * @Title : LocalTime 常用API 示例
 * @Remarks:
 * @Author : Weizhiguo
 * @Version: 1.0.0
 * @Date : 2022-04-30
 */
public class LocalTimeDemo {

    public static void main(String[] args) {
        // 1. 创建指定时间
        LocalTime time = LocalTime.of(10, 52, 36);
        System.out.println(time);

        // 2. 获取当前时间
        LocalTime now = LocalTime.now();
        System.out.println(now);
        System.out.println(now.getHour());          // 时
        System.out.println(now.getMinute());        // 分
        System.out.println(now.getSecond());        // 秒
        System.out.println(now.getNano());          // 纳秒
    }
}
